home *** CD-ROM | disk | FTP | other *** search
- Path: news.production.compuserve.com!news
- From: Dave Taylor <100440.2732@CompuServe.COM>
- Newsgroups: comp.lang.c
- Subject: Re: CONVERTING INTEGER TO ASCII??????
- Date: 28 Mar 1996 22:53:08 GMT
- Organization: -
- Message-ID: <4jf58k$ikp$1@mhade.production.compuserve.com>
- References: <315a0571.135066665@nntp.ix.netcom.com>
-
-
- A simple method of converting an integer to an ascii
- character is to use sprintf() e.g.:
-
- main()
- {
- char buf[500];
-
- sprintf(buf, "%d", 1234);
- printf("%s", buf);
- }
-
- This will 'display' the integer 1234 into the buffer 'buf'
- sprintf() converts each digit to the appropriate ascii
- character. 'buf' will therefore now contain a string of
- character digits.
-
- --
- Thanks Dave,
-